package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.JsonUser;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 接收Json字符串
 * @author stone
 * @date 2022/06/21 17:28
 */
@RestController
public class ReceiveJsonController {

    @RequestMapping("user/login")
    public BaseRespVo login(@RequestBody JsonUser user) {
        return BaseRespVo.ok(user);
    }

    @RequestMapping("user/login2")
    public BaseRespVo login2(@RequestBody Map map) {
        Object username = map.get("username");
        return BaseRespVo.ok(map);
    }
}
